import { CancelToken } from 'axios';
import http from './http';

export const queryRoleListApi = (params: IPageQueryParams & { keyword?: string }, token?: CancelToken): TS<IRoleModel> => http.get('/role/list', { params, cancelToken: token });

// 获取分配菜单的 原始数据
export const getAllMenuApi = (): RS<IMenuModel[]> => http.get('/menu/treeList');

export const getRoleMenusListApi = (roleId: number): RS<IMenuModel[]> => http.get(`/role/listMenu/${roleId}`);

export const getAllResourceApi = (): RS<IResourceModel[]> => http.get(`/resource/listAll`)

export const getRoleResourceApi = (roleId: number): RS<IResourceModel[]> => http.get(`/role/listResource/${roleId}`)

export const getAllResourceTypeApi = (): RS<IResourceCategoryModel[]> => http.get(`/resourceCategory/listAll`)